cmake_minimum_required(VERSION 3.20)

set(CMAKE_CXX_STANDARD 17)

# 项目名称
project(Partition LANGUAGES CXX)


# 获取此项目源文件
glob_recurse_all_cpp_files("${CMAKE_CURRENT_SOURCE_DIR}" ALL_CPP_FILES)
add_executable(${PROJECT_NAME} ${ALL_CPP_FILES} ${CMAKE_SOURCE_DIR}/Resource/version.rc)


# 设置头文件查找目录
target_include_directories(
  ${PROJECT_NAME}
  PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../
  PRIVATE ${CMAKE_INSTALL_PREFIX}/include/)

# 链接库
target_link_directories(${PROJECT_NAME} PRIVATE ${CMAKE_INSTALL_PREFIX}/lib)
target_link_libraries(
  ${PROJECT_NAME}
  PRIVATE Logging
  PRIVATE Configuration
  PRIVATE Exception
  PRIVATE Stacktrace
  PRIVATE Algebra
  PRIVATE DataStructure
  PRIVATE DBManager
  PRIVATE Import
  PRIVATE Framework
  PRIVATE ElementCalculator
  PRIVATE PublicElement
  PRIVATE ADVEleCalculator
  PRIVATE Constraint
  PRIVATE SolverTask
  PRIVATE Export)

# 导入第三方库
import_eigen3()


# 安装设置
install(
  TARGETS ${PROJECT_NAME}
  ARCHIVE DESTINATION lib
  RUNTIME DESTINATION bin)

